import React, {useState} from 'react'
import Button from './button';


function TodoList(props) {
    let {
        todoList,
        del
    } = props;
    return (
        <div>
            <ul>
                {todoList.map(todo => 
                <li key={todo.id}>
                    {todo.value}
                    <Button onClick={()=>{del(todo)}}>delete</Button>
                </li>)}
            </ul>
        </div>
    ) 
}

export default TodoList